<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>修改登录密码</title>
		<link rel="stylesheet" type="text/css" href="__API__/lib/css/swiper.min.css">
		<link rel="stylesheet" type="text/css" href="__API__/lib/css/mui.css?v=1">
		<link rel="stylesheet" type="text/css" href="__API__/lib/css/mobileSelect.css" />
		<link rel="stylesheet" href="__API__/lib/css/style.css">
		<script type="text/javascript" src="__API__/lib/js/jquery-1.11.0.min.js"></script>
		<script type="text/javascript" src="__API__/lib/js/mui.js"></script>
		<script src="__API__/lib/js/mobileSelect.js" type="text/javascript" charset="utf-8"></script>
		<script src="__API__/lib/js/city.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="__API__/lib/js/swiper.min.js"></script>
		<script type="text/javascript" src="__API__/lib/js/vue.min.js"></script>
		<script type="text/javascript" src="__API__/lib/js/common.js"></script>
		<script type="text/javascript" src="__API__/lib/js/index.js"></script>
	<script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script></head>

	<body>
		<div class="page_box" id="app" style="min-height: 100vh;">
			<div class="bank_cont">
				<div class="bank_box">
					<ul class="bank_list update_list">
						<li>
							<span>姓名</span>
							<input type="text" placeholder="" v-model="nickname"  />
						</li>
						<li>
							<span>性别</span>
							<input type="text" placeholder="" v-model="sex"  id="gender" readonly/>
							<div class="arrow"><img src="__API__/lib/images/more.png" alt=""></div>
						</li>
						<li>
							<span>手机</span>
							<input type="text" placeholder="" v-model="mobile" readonly />
<!--							<p class="blue" @click="goDetail('update_phone.html')">更换号码</p>-->
						</li>
					</ul>
				</div>
				<div class="blue_btn bank_btn" @click="onSubmit()">保存</div>
			</div>
		</div>
		<script>
			$(function() {
				// 性别选择
				var mobileSelect = new MobileSelect({
					trigger: '#gender',
					wheels: [{
						data: [{id: 0,value:'男'},{id: 1,value:'女'}]
					}],
					ensureBtnText: '确定',
					position: [1],
					callback: function(indexArr, data) {
						console.log(data)
						app.$data.sex = data[0].value;
					}
				});
			})
			var app = null;
			app = new Vue({
				el: '#app',
				data: {
					username: '',
					gender: '',
					mobile: '',
					nickname:'',
					sex:''

				},
				created: function() {
					var that = this;
					common.ajax("{:url('Member/my')}",{token:localStorage.getItem('token')} , function(res) {
						//common.showToast(res.msg);
						that.nickname = res.data.nickname;
						that.mobile = res.data.mobile;
						that.sex = res.data.sex;
						// that.getData(searchValue);
					})
				},
				methods: {
					goDetail(url) {
						common.openUrl(url)
					},
					onSubmit() {
						let that = this;
						let data = {
							token:localStorage.getItem('token'),
							nickname: that.nickname,
							sex: that.sex
						}
						common.ajax("{:url('Member/update')}",data , function(res){
							common.showToast(res.msg);
							if(res.code == 200){

								setTimeout(function() {
									common.PageBack();
									// common.openUrl("{:url('index')}");
								}, 1000)
							}
						})

					}
				}
			});
		</script>
	</body>

</html>
